Multiple References
QuickDraw GX allows multiple items in a picture to reference the same shape. Figure 6-6 shows an example of a picture shape containing four items. In this example, each item references the same shape: a black rectangle.Figure 6-6 A picture containing multiple references to the same shape
Figure 6-7 shows the condensed view of the picture from Figure 6-6.
Figure 6-7 A condensed view of a picture with multiple references
Although the picture shape shown in Figure 6-7 contains four references to the black rectangle, only one black rectangle appears when the picture is drawn. You might expect the rectangle to be drawn four times; however, it only appears once because the rectangle is redrawn in the same location four times.
Having multiple references to the same shape becomes more useful when you add overriding information. For example, if you add overriding transforms to three of the items in the picture shape from Figure 6-6, all four items appear when the picture is drawn, as shown in Figure 6-8.
Figure 6-8 Multiple references with overriding transforms
The picture shape in Figure 6-8 contains four items each referencing the same black rectangle shape. However, the second, third, and fourth items contain overriding transforms. When drawing this picture shape, QuickDraw GX applies the original transform when drawing the first item, and applies the overriding transforms when drawing the second, third, and fourth items. In this way, the four items appear separate when the picture is drawn, even though all four items reference the same shape.
You can use overriding styles and inks to make multiple references even more powerful. In Figure 6-9, the second item has an overriding style as well as an overriding transform, the third item has an overriding ink as well as an overriding transform, and the fourth item has an overriding transform that not only moves, but scales and clips as well.
Figure 6-9 Multiple references with overriding styles, inks, and transforms
Although each item in the picture shape shown in Figure 6-9 references the same black rectangle, the use of overriding styles, inks, and transforms creates substantial variations in the items of the picture as drawn.
For more examples of multiple references and overriding styles, inks, and transforms, see "Adding Multiple References" beginning on page 6-40.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help